﻿// TestDll.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//

#include <iostream>
#include "..\TestCore\Person.h"
#include "Test02.h"
//#include "..\TestCore\Test03.h"
#include "TestOpennurbs.h"
#include "TestClass.h"
#include <typeinfo>
#include "NSFrameSection.h"
void test01()
{
    Person person;
    person.Sit();
    Person* sa = &person;
    std::cout << (int)sa;
}
void test02()
{
    CandyShop* shop = new CandyShop();
    shop->a = 10;
    shop->b = 100;
    shop->c = 1000;

    CandyShop* shop2 = new CandyShop(*shop);

    cout << (int)shop << "_" << shop->a << "_" << shop->b << "_" << shop->c << "_" << endl;
    cout << (int)shop2 << "_" << shop2->a << "_" << shop2->b << "_" << shop2->c << "_" << endl;
}
void TestTeacher()
{
    Student st;
    st.age = 18;
    TeacherP tp;
    tp.age = 40;
    tp.student = &st;
    tp.Call();

}
void TestFather()
{
    Son son;
    son.year = 1990;
    Father sd(son);
    Father* ss = &son;
    Father& sk = son;
    cout << son.year << endl;
    Son* sonPtr1 = static_cast<Son*>(&sd);
    Son* sonPtr2 = static_cast<Son*>(ss);
    Son* sonPtr3 = (Son*)(&sk);
    //son.SetId(100);
    std::cout << son.GetId() << endl;
    cout << typeid(sd).name() << endl;
    cout <<"father复制构造函数"<< sonPtr1->year << endl;
    cout << "father指针" << sonPtr2->year << endl;
    cout << "father引用" << sonPtr3->year << endl;
}

void TestAdress()
{
    Son son;
    son.year = 2000;

    Son son2;
    son2.year = 4000;

    Son* son3 = new Son();
    son3->year = 3000;

    Son* son4 = new Son();
    son4->year = 3000;

    cout << "son的地址1：" << (int)&(son.year) << endl;
    cout << "son的地址2：" << (int)&(son2.year) << endl;
    cout << "son的地址3：" << (int)&(son3->year) << endl;
    cout << "son的地址4：" << (int)&(son4->year) << endl;
}
void Judge(RectangleSection sec1, RectangleSection sec2)
{
   /* bool jd = sec1 == sec2;

    cout << jd << endl;

    cout << true << endl;*/
}

void TestOperator()
{
    RectangleSection sec1;
    sec1.SetHeight(500);
    sec1.SetWidth(800);

    RectangleSection sec2;
    sec2.SetHeight(500);
    sec2.SetWidth(800);
    //bool jd = sec1 == sec2;

    //cout << jd << endl;

   
    //cout << "-----" << endl;
    //Judge(sec1, sec2);
    
}

int main()
{
    TestAdress();
    //TestOperator();
    //TestFather();
    //TestTeacher();
    //TestCurve();
    //TestCircleCurve();
    //GetCurveLength();
    //Test05();
    //Test06();
    //Test07();
}

// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单
// 调试程序: F5 或调试 >“开始调试”菜单

// 入门使用技巧: 
//   1. 使用解决方案资源管理器窗口添加/管理文件
//   2. 使用团队资源管理器窗口连接到源代码管理
//   3. 使用输出窗口查看生成输出和其他消息
//   4. 使用错误列表窗口查看错误
//   5. 转到“项目”>“添加新项”以创建新的代码文件，或转到“项目”>“添加现有项”以将现有代码文件添加到项目
//   6. 将来，若要再次打开此项目，请转到“文件”>“打开”>“项目”并选择 .sln 文件
